package com.mo.scopeprivilege.web;


import com.mo.scopeprivilege.annotation.QueryScope;
import com.mo.scopeprivilege.model.user.User;
import com.mo.scopeprivilege.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserServiceImpl userService;

    @QueryScope
    @RequestMapping("/find/all")
    public List<User> findAll(User user) {
        List<User> userList = null;
        userList = userService.findAll(user);
        return userList;
    }
}
